<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/header :: header}">
</head>
    <body>

    <div class="container blog-content-container">
 
		<form th:action="@{/updatePwd}"  method="post" onsubmit="return forgetSubmit()">
			<h2 class="form-signin-heading">修改密码</h2>
			<input type="hidden" name="username" th:value="${username}"/>
			<div class="form-group col-md-5">
				<label for="password" class="col-form-label">密码</label>
				<input type="password" class="form-control" id="password" name="password" maxlength="30" placeholder="请输入密码，字母或特殊符号和数字结合" >
			</div>
			<div class="form-group col-md-5">
				<label for="password2" class="col-form-label">重新输入</label>
				<input type="password" class="form-control" id="password2" name="password2" maxlength="30" placeholder="请重新输入密码" >
			</div>
			<div class="form-group">
				<button type="submit" class="btn btn-primary">提交</button>
			</div> 
		</form>
    </div> <!-- /container -->
	<div th:replace="~{fragments/footer :: footer}">...</div>
	<script>
		function forgetSubmit() {
		    if($("#password").val().length<=0||$("#password2").val().length<=0){
		        console.log(1);
		        return false;
			}
			if($("#password").val() != $("#password2").val()){
                console.log(2);
                toastr.error("两次密码不一致");
                return false;
			}
		    return true;
        }
	</script>
    </body>
</html>